<?php
/**
 * Created by PhpStorm.
 * User: meng
 * Date: 2023/12/21
 * Time: 11:51
 */

namespace app\admin\validator;

use lib\common\CommonValidator;

class SettingValidator extends CommonValidator
{
    protected $rule = [
        'name'       => 'require|max:255',
        'remark'     => 'max:255',
        'list_order' => 'require|number',
        'parentid'   => 'require|number'
    ];

    protected $message = [
        'name.require' => '请输入配置名称',
        'name.max'     => '配置名称不能超过255字符',
        'remark.max'   => '备注不能超过255字符',
        'list_order'   => '排序必填且只能是整数',
        'parentid'     => '请选择父级分类'
    ];

    protected $scene = [
        'create' => ['name', 'remark', 'list_order', 'parentid'],
        'update' => ['name', 'remark', 'list_order', 'parentid'],
    ];
}
